
import { _decorator, Component, Node, loader, error } from 'cc';
const { ccclass, property } = _decorator;

/**
 * Predefined variables
 * Name = ResManager
 * DateTime = Fri Dec 24 2021 15:21:11 GMT+0800 (中国标准时间)
 * Author = linruimin
 * FileBasename = ResManager.ts
 * FileBasenameNoExtension = ResManager
 * URL = db://assets/ResManager.ts
 * ManualUrl = https://docs.cocos.com/creator/3.4/manual/zh/
 *
 */
 
@ccclass('ResManager')
export class ResManager {
    public static loadRes (url: string, type: any, cb: Function) {
        loader.loadRes(url, type, (err, res) => {
            if (err) {
                error(err.message || err);
                cb(err, res);
                return;
            }

            cb(err, res);
        });
    }
}

/**
 * [1] Class member could be defined like this.
 * [2] Use `property` decorator if your want the member to be serializable.
 * [3] Your initialization goes here.
 * [4] Your update function goes here.
 *
 * Learn more about scripting: https://docs.cocos.com/creator/3.4/manual/zh/scripting/
 * Learn more about CCClass: https://docs.cocos.com/creator/3.4/manual/zh/scripting/ccclass.html
 * Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.4/manual/zh/scripting/life-cycle-callbacks.html
 */
